Software Transactional Memory (STM) Systems are known in the art. In general, these systems provide primitives useful for concurrent programming and other applications that allow a program to designate a set of actions as a transaction, in that the actions within the transaction execute atomically. Typically, the primitives include commands or calls to begin a transaction, to terminate a transaction normally, and to abort a transaction and roll back all effects of the aborted transaction. Many known implementations of STM systems exist. STM systems are implemented in software and so may be distinguished from hardware-based transactional memory (HTM) systems.
A useful primitive for use in concurrent programs is atomic Multi-Word Compare and Swap (MCAS). This primitive executes atomically. It compares the values in a set of memory locations in memory with a provided corresponding set of values. If each provided value matches the corresponding value in memory, the MCAS primitive then stores a provided set of new values into the set of memory locations, and returns a completion code indicating success; otherwise, no changes are made to memory and MCAS returns a completion code indicating failure. Existing implementations of MCAS such as Fraser, Practical Lock Freedom (Keir Fraser, Practical Lock Freedom, PhD. dissertation) use pointer values, and either logging or buffering of updates (during the MCAS operation) to ensure atomicity. Such buffering or logging adds overhead to such MCAS implementations.